import request from '@/utils/request'

/** 授权第三方账号
 * @deprecated
 * @param code
 * @param avatar
 * @return {Promise<unknown>}
 */
export function grant(code, avatar) {
    return request({
        url: '/oauth/grant',
        method: 'post',
        data:{
            code,
            source: 'wechat',
            avatar,
        }
    })
}

/** 解绑第三方账号
 * @deprecated
 * @param {'wechat'|'apple'} source
 * @return {Promise<unknown>}
 */
export function unbind(source) {
    return request({
        url: '/oauth/unbind',
        method: 'delete',
        params:{
            source,
        }
    })
}
